<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>

<html>
<head>
    <title>审核成员</title>
</head>

<body>
<div class="content">
    <!--
    <div class="page-subcate-list">
        <div class="page-searchbox">
            <div class="pull-right">
                <button onclick="javascript:toVolunteers();"><i class="fa fa-plus" aria-hidden="true" ></i>添加管理员</button>
            </div>
        </div>
    </div>
    -->
    <br/>
    <table class="table table-bordered">
        <thead>
        <tr>
            <th>姓名</th>
            <th>手机</th>
            <th>性别</th>
            <th>申请日期</th>
            <th style="text-align:center">操作</th>
        </tr>
        </thead>
        <tbody>
        <c:forEach items="${data.content}" var="item">
            <tr id="id="waite_${item.id}"">
                <td>${item.volunteer.realName}</td>
                <td>${item.volunteer.mobile}</td>
                <td>${item.volunteer.sex}</td>
                <td>${item.createTime}</td>
                <td align="center">
                    <a href="${ctx}/volunteer/detail/${item.volunteer.memberCode}">查看</a>
                    <a href="javascript:void(0);" onclick="javascript:verfier('${item.id}','2')">通过</a>
                    <a href="javascript:void(0);" onclick="javascript:verfier('${item.id}','-1')">拒绝</a>
                </td>
            </tr>
        </c:forEach>
        </tbody>
    </table>
    <tags:pagination page="${data}" paginationSize="5"/>

</div>
<script>
    function verfier(id,status)
    {
        var url = "${ctx}/groupVolunteer/verfier";
        $.post(url, {"id":id,"status": status}, function (result) {
                alert(result.message);
                if(result.code ==0)
                    $('#waite_'+id).remove();
        }, "json");
    }
</script>
</body>
</html>
